package cn.singno.springBoot.demo.ch02;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class JavaConfig
{
	@Bean(initMethod="init", destroyMethod="close")
	public FunctionService functionService(){
		return new FunctionService();
	}
	
	@Bean(initMethod="init", destroyMethod="close")
	public UseFunctionService useFunctionService(){
		UseFunctionService useFunctionService = new UseFunctionService();
		useFunctionService.setFunctionService(functionService());
		return useFunctionService;
	}
}
